package com.changfen.service;

import com.changfen.domain.Order;
import com.changfen.dto.OrderDto;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * @author changfeng.chen@things-matrix.com
 * @date 2022/9/28 18:12
 **/
@LocalTCC
public interface TccOrderService {
    @TwoPhaseBusinessAction(name = "addOrderTcc", commitMethod = "commit", rollbackMethod = "rollback")
    boolean createAddOrder(BusinessActionContext businessActionContext,
                                  @BusinessActionContextParameter(paramName = "order") Order order);

    boolean commit(BusinessActionContext businessActionContext);


    boolean rollback(BusinessActionContext businessActionContext);
}
